import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/personalcenter',
    name: 'Home',
    component: Home
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index/Index.vue')

  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register/Register.vue')

  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login/Login.vue')

  },
  {
    path: '/shoppingcart',
    name: 'shoppingcart',
    component: () => import('../views/ShoppingCart/ShoppingCart.vue')

  },
  {
    path: '/PersonalCenter',
    name: 'PersonalCenter',
    component: () => import('../views/PersonalCenter/PersonalCenter.vue')

  },
  {
    path: '/allproducts',
    name: 'allproducts',
    component: () => import('../views/AllProducts/AllProducts.vue')

  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
